//API层

class API {
    //创建数据
    createData(yourModel, yourObj) {
        //yourModel模型类型
        //yourObj模型数据
        return Model[yourModel].create(yourObj)
    }

    //查询数据
    findData(yourModel, were, attributes) {
        return Model[yourModel].findAll({
            //yourModel模型名称，string
            //were查询条件，object(要查询的对象)
            //查询字段,Array [字段1，字段2.。。]
            where: were,
            attributes

        })
    }
}

module.exports = new API()